using System.Text.Json;
using System.Text.Json.Serialization;
using SumerCoreDevOps.Shared.Models.Messages;

namespace SumerCoreDevOps.Shared.Serialization;

/// <summary>
/// JSON 源生成器上下文 - 优化序列化性能
/// </summary>
[JsonSourceGenerationOptions(
    PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase,
    GenerationMode = JsonSourceGenerationMode.Metadata,
    DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)]
[JsonSerializable(typeof(NodeRegisterMessage))]
[JsonSerializable(typeof(RegisterResponseMessage))]
[JsonSerializable(typeof(HeartbeatMessage))]
[JsonSerializable(typeof(HeartbeatResponseMessage))]
[JsonSerializable(typeof(WorkflowStepDispatchMessage))]
[JsonSerializable(typeof(StepStatusReportMessage))]
[JsonSerializable(typeof(ContextSyncMessage))]
[JsonSerializable(typeof(CredentialRequestMessage))]
[JsonSerializable(typeof(CredentialResponseMessage))]
[JsonSerializable(typeof(LogStreamMessage))]
[JsonSerializable(typeof(CleanupCommandMessage))]
[JsonSerializable(typeof(CleanupResultMessage))]
[JsonSerializable(typeof(NodeHardwareInfo))]
[JsonSerializable(typeof(RetryPolicy))]
[JsonSerializable(typeof(Dictionary<string, string>))]
public partial class MessageSerializerContext : JsonSerializerContext
{
}
